package com.pentofab.payrollmanagement.dao.model;

import com.pentofab.payrollmanagement.utilities.PayRollUtility;

public class Leave {
	
	Employee employee;
	String leaveType;
	String fromDate;
	String toDate;
	String approver;
	String reson;
	String halfDay;
	double noOfDays;
	double avaiblebleDays;
	
	public double getAvaiblebleDays() {
		return avaiblebleDays;
	}
	public void setAvaiblebleDays(double avaiblebleDays) {
		this.avaiblebleDays = avaiblebleDays;
	}
	public Employee getEmployee() {
		return employee;
	}
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}
	public String getHalfDay() {
		return halfDay;
	}
	public void setHalfDay(String halfDay) {
		this.halfDay = halfDay;
	}
	public String getLeaveType() {
		return leaveType;
	}
	public void setLeaveType(String leaveType) {
		this.leaveType = leaveType;
	}
	public String getFromDate() {
		
		if(fromDate != null)
			try{
			this.fromDate = PayRollUtility.convertDateToString(PayRollUtility.convertStringToDate(fromDate));
			}catch(Exception e){
				
			}
		return fromDate;
	}
	public void setFromDate(String fromDate) {
		this.fromDate = fromDate;
	}
	public String getToDate() {
		if(toDate != null)
			try{
			this.toDate = PayRollUtility.convertDateToString(PayRollUtility.convertStringToDate(toDate));
			}catch(Exception e){
				
			}
		return toDate;
	}
	public void setToDate(String toData) {
		this.toDate = toData;
	}
	public String getApprover() {
		return approver;
	}
	public void setApprover(String approver) {
		this.approver = approver;
	}
	public String getReson() {
		return reson;
	}
	public void setReson(String reson) {
		this.reson = reson;
	}
	public double getNoOfDays() {
		return noOfDays;
	}
	public void setNoOfDays(double noOfDays) {
		this.noOfDays = noOfDays;
	}
	/**
	 * Constructs a <code>String</code> with all attributes
	 * in name = value format.
	 *
	 * @return a <code>String</code> representation 
	 * of this object.
	 */
	/**
	 * Constructs a <code>String</code> with all attributes
	 * in name = value format.
	 *
	 * @return a <code>String</code> representation 
	 * of this object.
	 */
	public String toString()
	{
	    final String TAB = "    ";
	    
	    String retValue = "";
	    
	    retValue = "Leave ( "
	        + super.toString() + TAB
	        + "employee = " + this.employee + TAB
	        + "leaveType = " + this.leaveType + TAB
	        + "fromDate = " + this.fromDate + TAB
	        + "toDate = " + this.toDate + TAB
	        + "approver = " + this.approver + TAB
	        + "reson = " + this.reson + TAB
	        + "halfDay = " + this.halfDay + TAB
	        + "noOfDays = " + this.noOfDays + TAB
	        + "avaiblebleDays = " + this.avaiblebleDays + TAB
	        + " )";
	
	    return retValue;
	}
	
	
	
	

}
